{% extends "base.html" %}

{% block BaseHead %}
<style type="text/css">
    /** margin and padding on body element
     * can introduce errors in determining
     * element position and are not recommended;
     * we turn them off as a foundation for YUI
     * CSS treatments. 
     */
    body {
        margin:0;
        padding:0;
    }
</style>

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/menu/assets/skins/sam/menu.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/button/assets/skins/sam/button.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/container/assets/skins/sam/container.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/editor/assets/skins/sam/editor.css" />
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>

<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/container/container-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/menu/menu-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/button/button-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/editor/editor-min.js"></script>

{% endblock %}

{% block BaseBrowserTitle %}
Edit Wiki Page - {{ page.wiki_title }}
{% endblock %}

{% block BasePageTitle %}
    Edit Wiki Page - {{ page.wiki_title }}
{% endblock %}

{% block BaseBody %}
    <div class=" yui-skin-sam" style="clear: both;">
    <form action="/wikisave/{{ page.wiki_title }}" method="POST">
        <div style="width:100%" style="margin-bottom:0.4em" >
            <input type="submit" value="Save Changes"  />
            <input type="submit" value="Set Map Location" />
        </div>
        Page Title: 
        <input type="text" name="title" value="Replace {{ page.wikititle }} with the page's title" 
                     style="width:50%; margin-bottom:0.4em" />
        <div style="clear: both;" >
            <textarea id="idPageContent" name="body" rows="37" cols="75" >{{ page.content }}</textarea>
        </div>
    </form>
    </div>
    
    <script>
        (function() {
            var Dom = YAHOO.util.Dom,
                Event = YAHOO.util.Event;
            
            var myConfig = {
                height: '300px',
                width: '600px',
                dompath: true,
                focusAtStart: true
            };
        
            var myEditor = new YAHOO.widget.Editor('idPageContent', myConfig);
            myEditor._defaultToolbar.buttonType = 'basic';
            myEditor.render();
        })();
    </script>

{% endblock %}
